package logic.table;

import logic.constants.DefaultConsts;
import logic.util.logutil.LogUtil;
import android.provider.BaseColumns;

/**
 * 离线
 * @author 刘宾  
 * @date 2014年8月11日 上午10:45:01
 */
public class DownloadsTable {

	public static final String table = "lq_downloads";

	public class DownLoadsColums implements BaseColumns {
		public final static String ID 			= "id";
		public final static String UID 			= "uid";
		public final static String URI 			= "uri";
		public final static String HINT 		= "hint";
		public final static String _DATE 		= "_date";
		public final static String MIMETYPE 	= "mimetype";
		public final static String VISIBILITY 	= "visibility";
		public final static String STATUS 		= "status";
		public final static String LASTMOD 		= "lastmod";
		public final static String COOKIEDATA 	= "cookiedata";
		public final static String TOTAL_BYTES 	= "total_bytes";
		public final static String CURRENT_BYTES = "current_bytes";
		public final static String TITLE 		= "title";
		public final static String AUTHOR 		= "author";
		public final static String IS_ORDER 	= "is_order";
		public final static String PRICE 		= "price";
		public final static String CONTENT_TYPE = "content_type";
		public final static String TICKET_URL 	= "ticket_url";
		public final static String DESCRIPTION 	= "description";
	}

	public static String getCreateTableSQL() {
		StringBuilder sb = new StringBuilder();
		sb.append("CREATE TABLE IF NOT EXISTS " + table + "(");

		sb.append(DownLoadsColums.ID + " INTEGER PRIMARY KEY AUTOINCREMENT,");
		sb.append(DownLoadsColums.UID + " TEXT,");
		sb.append(DownLoadsColums.URI + " TEXT, ");
		sb.append(DownLoadsColums.HINT + " TEXT,");
		sb.append(DownLoadsColums._DATE + " TEXT,");
		sb.append(DownLoadsColums.MIMETYPE + " TEXT,");
		sb.append(DownLoadsColums.VISIBILITY + " INTEGER,");
		sb.append(DownLoadsColums.STATUS + " INTEGER,");
		sb.append(DownLoadsColums.LASTMOD + " TEXT,");
		sb.append(DownLoadsColums.COOKIEDATA + " TEXT,");
		sb.append(DownLoadsColums.TOTAL_BYTES + " INTEGER,");
		sb.append(DownLoadsColums.CURRENT_BYTES + " INTEGER,");
		sb.append(DownLoadsColums.TITLE + " TEXT,");
		sb.append(DownLoadsColums.AUTHOR + " TEXT,");
		sb.append(DownLoadsColums.IS_ORDER + " TEXT,");
		sb.append(DownLoadsColums.PRICE + " TEXT,");
		sb.append(DownLoadsColums.CONTENT_TYPE + " TEXT,");
		sb.append(DownLoadsColums.TICKET_URL + " TEXT,");
		sb.append(DownLoadsColums.DESCRIPTION + " INTEGER");
		sb.append(");");
		LogUtil.d(DefaultConsts.TAG, table+":"+sb.toString());
		return sb.toString();
	}
}
